From 9ab2587f30cc4e186f1afb76428ec83c28d7f46c Mon Sep 17 00:00:00 2001 From: "vhanquez@kneesa.uk.xensource.com" Date: Tue, 27 Dec 2005 10:40:33 +0000 Subject: [PATCH] Prevent vbd frontend from oopsing if the underlying device doesn't exist. Signed-off-by: Horms Signed-off-by: Vincent Hanquez --- linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c index 7140449af1..2ec97d1e0b 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c @@ -331,7 +331,12 @@ static void connect(struct blkfront_info *info) return; } - xlvbd_add(sectors, info->vdevice, binfo, sector_size, info); + err = xlvbd_add(sectors, info->vdevice, binfo, sector_size, info); + if (err) { + xenbus_dev_fatal(info->xbdev, err, "xlvbd_add at %s", + info->xbdev->otherend); + return; + } (void)xenbus_switch_state(info->xbdev, NULL, XenbusStateConnected); -- 2.30.2